package com.airy.highSpeed.service.impl;


import com.airy.highSpeed.dao.mysql.TrHourFlowDao;
import com.airy.highSpeed.dao.oracle.RktxDao;
import com.airy.highSpeed.entity.RktxEntity;
import com.airy.highSpeed.entity.TrHourFlowEntity;
import com.airy.highSpeed.service.RktxService;
import com.airy.highSpeed.service.TrHourFlowService;
import com.airy.highSpeed.utils.PageUtils;
import com.airy.highSpeed.utils.Query;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("trhourflowService")
public class TrHourFlowServiceImpl extends ServiceImpl<TrHourFlowDao, TrHourFlowEntity> implements TrHourFlowService {

    @Autowired
    TrHourFlowDao trHourFlowDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TrHourFlowEntity> page = this.page(
                new Query<TrHourFlowEntity>().getPage(params),
                new QueryWrapper<TrHourFlowEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<TrHourFlowEntity> findAll() {
        return trHourFlowDao.findAll();
    }

    @Override
    public void insertTrHourFlow(TrHourFlowEntity trHourFlowEntity) {
        trHourFlowDao.insertTrHourFlow(trHourFlowEntity);
    }

    @Override
    public void updateEtcFlowAndMtcFlowBySTARTTIMEAndSTATIONID(String startTime, String tollStationId, Integer flage, Integer etcFlow, Integer mtcFlow ,String insertTime) {
        trHourFlowDao.updateEtcFlowAndMtcFlowBySTARTTIMEAndSTATIONID(startTime,tollStationId,flage,etcFlow,mtcFlow,insertTime);
    }

}